package ru.ifmo.filemanager.filesystem.requests;

import ru.ifmo.filemanager.core.Core;
import ru.ifmo.filemanager.filesystem.FileSystem;

public abstract class Request {

	public volatile boolean cancelled;
	
	void cancel() {
		cancelled = true;
		Core.execute(new Runnable() {
			
			public void run() {
				
				if (FileSystem.getCurrentRequest() == Request.this) {
					FileSystem.setCurrentRequest(null);
				}
			}
		});
	}
}
